package qianting.news.search.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qianting.news.apis.models.search.dtos.UserSearchDto;
import qianting.news.common.entity.State;
import qianting.news.search.service.ApAssociateWordsService;

@Api(tags = "搜索联想词管理")
@RestController
@RequestMapping("/associate")
public class ApAssociateWordsController {

    @Autowired
    private ApAssociateWordsService apAssociateWordsService;

    @ApiOperation(value = "关键字查询联想词")
    @PostMapping("/load")
    public State search(@RequestBody UserSearchDto userSearchDto) {
        return apAssociateWordsService.findAssociate(userSearchDto);
    }
}
